package com.yihua.obj;

import com.yihua.GameWin;
import com.yihua.utils.GameUtils;

import java.awt.*;
import java.util.Random;

public class FoodObj extends GameObj {
    Random r = new Random();
    @Override
    public void drawSelf(Graphics g) {
        super.drawSelf(g);
    }

    public FoodObj() {
        super();
    }

    public FoodObj(Image image, int x, int y, GameWin gameWin) {
        super(image, x, y, gameWin);
    }
    //获取食物
    public FoodObj getFood(){
        return new FoodObj(GameUtils.foodImg,r.nextInt(20)*30,(r.nextInt(19)+1)*30,this.gameWin);
    }
}
